<?php
    session_start();
    //require_once './inc_onlinestoredb.php'; page 586
    require_once './class/class_onlinestore.php'; 
	$storeID = "MEN";
	$storeInfo = array();
        if(class_exists("OnlineStore")){
            if (isset($_SESSION['currentStore']))
                $store = unserialize ($_SESSION['currentStore']);
            else {
                $store = new OnlineStore();
            }  
			$store->setStoreID($storeID);	
			$storeInfo = $store->getStoreInformation();
			$store->processUserInput();			
			//checks for ItemToAdd
			//if (isset($_GET['ItemToAdd'])) {
			//	$store->addItem();
			//}
        }
        else{
            $errormsg[] = "The OnlineStore class is not available";
            $store = NULL;
        }
?>

<?php include('header.php'); ?>
		<h1><?php echo htmlentities($storeInfo['name']); ?></h1>
		<h2><?php echo htmlentities($storeInfo['description']); ?></h2>
		<p><?php echo htmlentities($storeInfo['welcome']); ?></p>
	<!--	<p>Inventory</p> -->
			
		<?php
			$store->getProductList();
			$_SESSION['currentStore'] = serialize($store);
		?>	
		<p></p>
<?php include('footer.php'); ?>